#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {
	char name[20] = "zhangsan";
	int age = 20;
	double math = 95.5;

	char buf[120] = { 0 };
	sprintf(buf, "%s %d %lf", name, age, math);

	printf("%s\n", buf);

	char name2[20] = "";
	int age2 = 0;
	double math2 = 0;
	sscanf(buf, "%s %d %lf", name2, &age2, &math2);

	printf("%lf\n", math2);
	return 0;
}